package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "withdrawal-bill-api")
public interface TbWithdrawalBillApi {

    // 申请提现v1
    @PostMapping("/member/withdrawalBill/apply")
    Result<Boolean> apply(@RequestBody WithdrawalApplyDto withdrawalApplyDto);

    // 申请提现v2
    @PostMapping("/member/withdrawalBill/applyV2")
    Result<Boolean> applyV2(@RequestBody WithdrawalApplyV2Dto withdrawalApplyV2Dto);

    // 小程序端提现记录列表
    @GetMapping("/member/withdrawalBill/pageWithdrawalBill")
    Result<Page<WithdrawalApplyPageVo>> pageWithdrawalBill(@SpringQueryMap WithdrawalApplyPageDto withdrawalApplyPageDto);

    @GetMapping("/member/withdrawalBill/pageMerchantWithdrawalBill")
    Result<Page<WithdrawalApplyPageVo>> pageMerchantWithdrawalBill(@SpringQueryMap WithdrawalApplyPageDto withdrawalApplyPageDto);

    // 管理后台提现记录列表
    @GetMapping("/member/withdrawalBill/pageAdminWithdrawalBill")
    Result<Page<AdminWithdrawalApplyPageVo>> pageAdminWithdrawalBill(@SpringQueryMap AdminWithdrawalApplyPageDto adminWithdrawalApplyPageDto);

    // 提现审核
    @PostMapping("/member/withdrawalBill/audit")
    Result<Boolean> audit(@RequestBody AdminWithdrawalApplyAuditDto adminWithdrawalApplyAuditDto);

    // 获取累计申请金额，累计已提现金额
    @GetMapping("/member/withdrawalBill/getWithdrawalAmt")
    Result<AdminWithdrawalAmtVo> getWithdrawalAmt(@SpringQueryMap AdminWithdrawalApplyPageDto adminWithdrawalApplyPageDto);

    // 消费提现打款消息
    @PostMapping("/member/withdrawalBill/consumerWithdrawalMsg")
    Result<Boolean> consumerWithdrawalMsg(@RequestParam("id") Long id);

    // 根据条件查询提现记录数据
    @GetMapping("/member/withdrawalBill/listByDto")
    Result<List<WithdrawalBillVo>> listByDto(@SpringQueryMap WithdrawalBillDto withdrawalBillDto);

    // 扫描提现中的提现流水
    @PostMapping("/member/withdrawalBill/scanWithdrawalBill")
    Result<Boolean> scanWithdrawalBill();

    // 补贴金不足的商家数据
    @GetMapping("/member/withdrawalBill/getSubsidyNoEnough")
    Result<SubsidyNoEnoughVo> getSubsidyNoEnough(@RequestParam("merchantId") Long merchantId);

    @GetMapping("/member/withdrawalBill/getMerchantAccWithdrawalAmt")
    Result<BigDecimal> getMerchantAccWithdrawalAmt(@RequestParam("merchantId") Long merchantId);

    @PostMapping("/member/withdrawalBill/checkBillConfirm")
    Result<Boolean> checkBillConfirm(@RequestBody CheckBillConfirmDto checkBillConfirmDto);

    @GetMapping("/member/withdrawalBill/checkBillInfo")
    Result<WithdrawalCheckBillVo> checkBillInfo(@RequestParam("checkBillId") Long checkBillId);

    // 结算池提现申请 - 打款 - 上传打款凭证
    @PostMapping("/member/withdrawalBill/uploadPaymentVoucher")
    Result<Boolean> uploadPaymentVoucher(@RequestBody AdminWithdrawalBillPaymentVoucherDto adminWithdrawalBillPaymentVoucherDto);

    // 结算池提现申请 - 获取打款凭证
    @PostMapping("/member/withdrawalBill/getPaymentVoucher")
    Result<TbWithdrawalBillPaymentVoucherVo> getPaymentVoucher(@RequestParam("withdrawalBillId") Long withdrawalBillId);

    @GetMapping("/member/withdrawalBill/initCheck")
    Result<WithdrawalCheckBillInitVo> initCheck(@RequestParam("withdrawalId") Long withdrawalId);

    @GetMapping("/member/withdrawalBill/checkInfo")
    Result<WithdrawalCheckBillInitVo> checkInfo(@RequestParam("checkBillId") Long checkBillId);

    @GetMapping("/member/withdrawalBill/preCheckBill")
    Result<WithdrawalCheckBillPreVo> preCheckBill(@RequestParam("checkBillId") Long checkBillId);

    @PostMapping("/member/withdrawalBill/saveCheckBill")
    Result<Boolean> saveCheckBill(@RequestBody WithdrawalCheckBillSaveDto checkBillSaveDto);

    @GetMapping("/member/withdrawalBill/sumAutoWithdrawalAmount")
    Result<BigDecimal> sumAutoWithdrawalAmount(@RequestParam("merchantId") Long merchantId, @RequestParam("state") Integer state);

}
